var path = require('path');
console.log("__dirname",__dirname)
module.exports = {
    entry: { index: path.join(__dirname, '/src/main/jsx/index.js') },
    output: {
        path: path.join(__dirname, '/src/main/resources/static/dist'),
        publicPath: "/dist/",
        filename: '[name].bundle.js'
    },
    devServer: {
        contentBase: path.join(__dirname, "/src/main/resources/static"),
        historyApiFallback: {
            index: '/manage/index.html'
        },
        proxy: {
            '/': {
                target: 'http://localhost:20002/',
                secure: false
            }
            // ttt"/login": {
            //     target: 'http://localhost:20000/',
            //     secure: false
            // }
        }
    },
    resolve: {
        extensions: ['', '.js', '.jsx']
    },
    module: {
        loaders: [
            { test: /\.css$/, loader: "style-loader!css-loader?url=false!postcss-loader" },
            { test: /\.(woff|woff2|ttf)$/, loader: 'url-loader?limit=256', output: "/resources" },
            {
                test: /\.js|jsx$/,
                loader: 'babel-loader',
                exclude: /node_modules|lib/,
                query: {
                    presets: ['es2015', 'react'],
                    plugins: ["transform-es2015-destructuring", "transform-object-rest-spread", "transform-class-properties"]
                }
            }
        ]
    }
}